package com.aqiang.home;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.aqiang.common.RouterPath;
import com.aqiang.core.view.BaseActivity;
import com.aqiang.home.contract.HomeContract;
import com.aqiang.home.presenter.HomePresenter;

@Route(path = RouterPath.HOME_ACTIVITY)
public class HomeActivity extends BaseActivity<HomePresenter> implements HomeContract.HomeView , View.OnClickListener {
    private Button mActHomeBt;
    private TextView mActHomeTv;
    @Override
    protected void initEvent() {
        mActHomeBt.setOnClickListener(this);
    }

    @Override
    protected void createPresenter() {
        mPresenter = new HomePresenter(this);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        mActHomeBt = (Button) findViewById(R.id.act_home_bt);
        mActHomeTv = (TextView) findViewById(R.id.act_home_tv);

    }

    @Override
    protected int bindLayout() {
        return R.layout.activity_home;
    }

    @Override
    public void setText(String s) {
        mActHomeTv.setText(s);
    }

    @Override
    public void onClick(View v) {
        mPresenter.getText();
    }
}
